/**
 * EventHelper
 * 公用事件监听/触发器
 */

  import "babel-polyfill";

  var util = require("util");
  var events = require("events");

  class Helper extends events.EventEmitter {
      constructor () {
          super();
      }
      trigger (eventName, data) {
          this.emit(eventName, data);
      }
      handle (eventName, callback = () => {}) {
          this.on(eventName, (data) => {
              callback(data);
          });
      }
      remove (eventName) {
          this.removeAllListeners(eventName);
      }
  }

  var helper = new Helper();
  // 设置最大监听器个数
  helper.setMaxListeners(50);

  export default helper;
